package com.housekeeper.maili.customjcvedioplayer;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;

import cn.jzvd.JZVideoPlayerStandard;

/**
 * Created by MAILI on 2017/11/13.
 */

public class CustomJZVedioPlayer extends JZVideoPlayerStandard{

    private ImageView mDown;
    private Context context;

    public CustomJZVedioPlayer(Context context) {
        super(context);
    }

    public CustomJZVedioPlayer(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.context = context;
        mDown = (ImageView) findViewById(R.id.img_down);
        mDown.setOnClickListener(this);
    }

    @Override
    public int getLayoutId() {
        return R.layout.jz_layout_standard;
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()) {
            case R.id.img_down:
                Toast.makeText(context, "下载", Toast.LENGTH_LONG).show();
                break;
        }
    }

    @Override
    public void setUp(String url, int screen, Object... objects) {
        super.setUp(url, screen, objects);
//        if (currentScreen == SCREEN_WINDOW_FULLSCREEN) {
//            mDown.setVisibility(VISIBLE);
//        } else {
//            mDown.setVisibility(INVISIBLE);
//        }
    }
}
